package com.heima.shopweb.service;

import com.zijie.core.util.JsonResult;
import com.zijie.goods.model.Goods;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

@FeignClient(value = "shop-gateway", contextId = "goods-feign")
public interface GoodFeignService {
    //热销
    @GetMapping("/goods-api/api/v1/goods/findHotByCount/{count}")
    ResponseEntity<JsonResult<List<Goods>>> findAllHot(@PathVariable("count") int count);
    //新品
    @GetMapping("/goods-api/api/v1/goods/findNewByCount/{count}")
    ResponseEntity<JsonResult<List<Goods>>> findNewByCount(@PathVariable("count") int count);

    @GetMapping("/goods-api/api/v1/goods/findById/{id}")
    ResponseEntity<JsonResult<Goods>> findById(@PathVariable("id") Integer id);
}